<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>欢迎注册</title>
    <style>
        .content{text-align:center;width:300px; margin: 0 auto;}
        .title{font-size: 20px; font-weight: bold;padding-bottom: 10px;}
        .register .set{padding-top: 10px;}
        th{text-align: right;}
        input{text-align: left;}
    </style>
    <script>
        function checkForm() {
            var pw1=document.getElementById("pw1").value;
            var pw2=document.getElementById("pw2").value;
            if(pw1!=pw2){
                alert('两次输入密码不一致');
                return false;
            }
            return true;
        }
    </script>
</head>
<body>
<div class="content">
    <form method="post" action="register.php" onsubmit="return checkForm(this.form)">
        <table class="register">
            <tr><td class="title" colspan="2">欢迎注册新用户</td></tr>
            <tr><th>用户名：</th><td><input type="text" name="usename"/></td></tr>
            <tr><th>邮箱：</th><td><input type="text" name="email"/></td></tr>
            <tr><th>密码：</th><td><input type="password" name="password"/></td></tr>
            <tr><th>确认密码：</th><td><input type="password"/></td></tr>
            <tr><td colspan="2" class="set">
                <input type="submit" value="提交注册"/>&nbsp;&nbsp;
                <input type="reset" value="重新填写"/>
            </td></tr>
        </table>
    </form>
</div>

</body>
</html>